From 7c14dbf19795703385845bb921b142f77e0e4f04 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Thu, 6 Jan 2005 23:46:53 +0000 Subject: [PATCH] bitkeeper revision 1.1159.212.8 (41ddcdedA_y3YPCIz7quwuaHg2Lhng) VMX bug fixes. --- xen/arch/x86/vmx.c | 2 +- xen/arch/x86/x86_32/entry.S | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/vmx.c b/xen/arch/x86/vmx.c index 53f5643580..f69002f4ed 100644 --- a/xen/arch/x86/vmx.c +++ b/xen/arch/x86/vmx.c @@ -75,7 +75,7 @@ int start_vmx() void stop_vmx() { - if (test_bit(X86_FEATURE_VMXE, &boot_cpu_data.x86_capability)) + if (read_cr4() & X86_CR4_VMXE) __vmxoff(); } diff --git a/xen/arch/x86/x86_32/entry.S b/xen/arch/x86/x86_32/entry.S index b111e0c12a..129c314999 100644 --- a/xen/arch/x86/x86_32/entry.S +++ b/xen/arch/x86/x86_32/entry.S @@ -75,14 +75,24 @@ * * We also need the room, especially because orig_eax field is used * by do_IRQ(). Compared the xen_regs, we skip pushing for the following: - * (1/1) u16 error_code; - * (2/1) u16 entry_vector; - * (2) u32 eip; - * (3) u32 cs; + * (10) u32 gs; + * (9) u32 fs; + * (8) u32 ds; + * (7) u32 es; + * <- get_stack_top() (= HOST_ESP) + * (6) u32 ss; + * (5) u32 esp; * (4) u32 eflags; + * (3) u32 cs; + * (2) u32 eip; + * (2/1) u16 entry_vector; + * (1/1) u16 error_code; + * However, get_stack_top() acturally returns 20 bytes below the real + * top of the stack to allow space for: + * domain pointer, DS, ES, FS, GS. Therefore, we effectively skip 6 registers. */ #define VMX_MONITOR_EFLAGS 0x202 /* IF on */ -#define NR_SKIPPED_REGS 4 /* See the above explanation */ +#define NR_SKIPPED_REGS 6 /* See the above explanation */ #define VMX_SAVE_ALL_NOSEGREGS \ pushl $VMX_MONITOR_EFLAGS; \ popf; \ -- 2.30.2